﻿using Abp.Application.Services;
using Abp.Domain.Repositories;
using Abp.Extensions;
using Abp.Linq.Extensions;
using Sunlit.Business.Serves.Dto;
using System.Linq;

namespace Sunlit.Business.Serves
{
    public class ServeCateAppService: AsyncCrudAppService<ServeCate, ServeCateDto,int,GetAllServeCateInput
        ,CreateServeCateInput,UpdateServeCateInput>, IServeCateAppService
    {
        public ServeCateAppService(IRepository<ServeCate> repository): base(repository)
        {

        }
        protected override IQueryable<ServeCate> CreateFilteredQuery(GetAllServeCateInput input)
        {
            return base.CreateFilteredQuery(input)
                .WhereIf(!input.Name.IsNullOrEmpty(), p => p.Name.Contains(input.Name));
        }
    }
}
